<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <vc:i18n name="访客详情" namespace="visitDetail"></vc:i18n>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_goBack()">
                            <i class="fa fa-close"></i>
                            <span><vc:i18n name="返回" namespace="visitDetail"></vc:i18n></span>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <div>
                        <div class="flex justify-start">
                            <div class="margin-right margin-top">
                                <image width="120px" class="border-radius" height="140px"
                                       v-bind:src="visitDetailInfo.pools.url" @error="errorLoadImg"></image>
                            </div>
                            <div class="margin-left">
                                <div class="row" v-if="visitDetailInfo.pools">
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="访客姓名" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.vName}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="访客电话" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.phoneNumber}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="随行人员" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.entourage}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="拜访时间" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.visitTime}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="离开时间" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.departureTime}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="申请时间" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.createTime}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="状态" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.stateName}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="车牌号" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.carNum}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="受访业主" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.ownerName}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="拜访说明" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.visitCase}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="车辆状态" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.carStateName}}</label>
                                        </div>
                                    </div>
                                    <div class="col-sm-4">
                                        <div class="form-group">
                                            <label class="col-form-label">
                                                <span><vc:i18n name="车辆审核备注" namespace="visitDetail"></vc:i18n></span>：
                                            </label>
                                            <label class="">{{visitDetailInfo.pools.carStateRemark}}</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row" v-if="visitDetailInfo.flowId">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="工单流转" namespace="visitDetail"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content">
                    <table class="table table-stripped">
                        <thead>
                        <tr>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="序号" namespace="visitDetail"></vc:i18n></span>
                            </th>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="部门" namespace="visitDetail"></vc:i18n></span>
                            </th>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="处理人" namespace="visitDetail"></vc:i18n></span>
                            </th>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="状态" namespace="visitDetail"></vc:i18n></span>
                            </th>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="耗时" namespace="visitDetail"></vc:i18n></span>
                            </th>
                            <th scope="col" class="text-center">
                                <span><vc:i18n name="意见" namespace="visitDetail"></vc:i18n></span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="(item,index) in visitDetailInfo.comments">
                            <td scope="row" class="text-center">{{index+1}}</td>
                            <td scope="row" class="text-center" v-if="item.orgName">{{item.orgName}}</td>
                            <td scope="row" class="text-center" v-else>
                                <span><vc:i18n name="管理员" namespace="visitDetail"></vc:i18n></span>
                            </td>
                            <td class="text-center">{{item.staffName}}</td>
                            <td class="text-center" v-if="item.endTime">
                                <span><vc:i18n name="处理完成" namespace="visitDetail"></vc:i18n></span>
                            </td>
                            <td class="text-center" v-else>
                                <span><vc:i18n name="正在处理" namespace="visitDetail"></vc:i18n></span>
                            </td>
                            <td class="text-center">{{item.duration}}</td>
                            <td class="text-center">{{item.context}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row" v-if="visitDetailInfo.action">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="工单办理" namespace="visitDetail"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content">
                    <div>
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label text-right">
                                <span><vc:i18n name="动作" namespace="visitDetail"></vc:i18n></span>
                            </label>
                            <div class="col-sm-10">
                                <select class="custom-select" v-model="visitDetailInfo.audit.auditCode">
                                    <option selected disabled value="">{{vc.i18n('请选择','visitDetail')}}</option>
                                    <option value="1100"
                                            v-if="visitDetailInfo.nextAudit.next || visitDetailInfo.nextAudit.exit">
                                        {{vc.i18n('同意','visitDetail')}}
                                    </option>
                                    <option value="1200" v-if="visitDetailInfo.nextAudit.back">
                                        {{vc.i18n('退回','visitDetail')}}
                                    </option>
                                    <option value="1400" v-if="visitDetailInfo.nextAudit.backIndex">
                                        {{vc.i18n('退回至提交者','visitDetail')}}
                                    </option>
                                    <option value="1300">{{vc.i18n('转单','visitDetail')}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label text-right">
                                <span><vc:i18n name="工单说明" namespace="visitDetail"></vc:i18n></span>
                            </label>
                            <div class="col-sm-10">
                                <textarea :placeholder="vc.i18n('必填，请填写工单说明','visitDetail')" class="form-control"
                                          v-model="visitDetailInfo.audit.auditMessage">
                                </textarea>
                            </div>
                        </div>
                        <!-- 办理时 判断是否指定 委托人 如果指定了 则不显示 -->
                        <div class="form-group row"
                             v-if="visitDetailInfo.audit.auditCode == '1100' && visitDetailInfo.nextAudit.assignee == '-2'">
                            <label class="col-sm-2 col-form-label text-right">
                                <span><vc:i18n name="下一处理人" namespace="visitDetail"></vc:i18n></span>
                            </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"
                                       :placeholder="vc.i18n('必填，请选择下一处理人','visitDetail')" disabled
                                       v-model="visitDetailInfo.audit.staffName">
                            </div>
                            <div class="col-sm-2">
                                <button class="btn btn-white " type="button" v-on:click="chooseStaff()">
                                    <i class="fa fa-search"></i>选择
                                </button>
                            </div>
                        </div>
                        <!-- 转单时 必须指定 委托人 -->
                        <div class="form-group row" v-if="visitDetailInfo.audit.auditCode == '1300'">
                            <label class="col-sm-2 col-form-label text-right">
                                <span><vc:i18n name="下一处理人" namespace="visitDetail"></vc:i18n></span>
                            </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"
                                       :placeholder="vc.i18n('必填，请选择下一处理人','visitDetail')" disabled
                                       v-model="visitDetailInfo.audit.staffName">
                            </div>
                            <div class="col-sm-2">
                                <button class="btn btn-white " type="button" v-on:click="chooseStaff()">
                                    <i class="fa fa-search"></i>选择
                                </button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <button class="btn btn-primary float-right" type="button" v-on:click="_auditSubmit()">
                                提交
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row" v-if="visitDetailInfo.flowId">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="流程图" namespace="visitDetail"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content text-center">
                    <img :src="visitDetailInfo.imgData" alt="" height="300px">
                </div>
            </div>
        </div>
    </div>
    <vc:create path="property/selectStaff"></vc:create>
</div>